Integrand size = 40, antiderivative size = 118 \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\left (a^2 B-b^2 B-2 a b C\right ) x+\frac {\left (a^2 B-b^2 B-2 a b C\right ) \cot (c+d x)}{d}-\frac {a (2 b B+a C) \cot ^2(c+d x)}{2 d}-\frac {a^2 B \cot ^3(c+d x)}{3 d}+\frac {\left (b^2 C-a (2 b B+a C)\right ) \log (\sin (c+d x))}{d} \]
[Out]
Time = 0.36 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {3713, 3685, 3709, 3610, 3612, 3556} \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {\left (a^2 B-2 a b C-b^2 B\right ) \cot (c+d x)}{d}+x \left (a^2 B-2 a b C-b^2 B\right )-\frac {a^2 B \cot ^3(c+d x)}{3 d}+\frac {\left (b^2 C-a (a C+2 b B)\right ) \log (\sin (c+d x))}{d}-\frac {a (a C+2 b B) \cot ^2(c+d x)}{2 d} \]
[In]
[Out]
Rule 3556
Rule 3610
Rule 3612
Rule 3685
Rule 3709
Rule 3713
Rubi steps \begin{align*} \text {integral}& = \int \cot ^4(c+d x) (a+b \tan (c+d x))^2 (B+C \tan (c+d x)) \, dx \\ & = -\frac {a^2 B \cot ^3(c+d x)}{3 d}+\int \cot ^3(c+d x) \left (a (2 b B+a C)-\left (a^2 B-b^2 B-2 a b C\right ) \tan (c+d x)+b^2 C \tan ^2(c+d x)\right ) \, dx \\ & = -\frac {a (2 b B+a C) \cot ^2(c+d x)}{2 d}-\frac {a^2 B \cot ^3(c+d x)}{3 d}+\int \cot ^2(c+d x) \left (-a^2 B+b^2 B+2 a b C+\left (b^2 C-a (2 b B+a C)\right ) \tan (c+d x)\right ) \, dx \\ & = \frac {\left (a^2 B-b^2 B-2 a b C\right ) \cot (c+d x)}{d}-\frac {a (2 b B+a C) \cot ^2(c+d x)}{2 d}-\frac {a^2 B \cot ^3(c+d x)}{3 d}+\int \cot (c+d x) \left (b^2 C-a (2 b B+a C)+\left (a^2 B-b^2 B-2 a b C\right ) \tan (c+d x)\right ) \, dx \\ & = \left (a^2 B-b^2 B-2 a b C\right ) x+\frac {\left (a^2 B-b^2 B-2 a b C\right ) \cot (c+d x)}{d}-\frac {a (2 b B+a C) \cot ^2(c+d x)}{2 d}-\frac {a^2 B \cot ^3(c+d x)}{3 d}+\left (b^2 C-a (2 b B+a C)\right ) \int \cot (c+d x) \, dx \\ & = \left (a^2 B-b^2 B-2 a b C\right ) x+\frac {\left (a^2 B-b^2 B-2 a b C\right ) \cot (c+d x)}{d}-\frac {a (2 b B+a C) \cot ^2(c+d x)}{2 d}-\frac {a^2 B \cot ^3(c+d x)}{3 d}+\frac {\left (b^2 C-a (2 b B+a C)\right ) \log (\sin (c+d x))}{d} \\ \end{align*}
Result contains complex when optimal does not.
Time = 1.27 (sec) , antiderivative size = 152, normalized size of antiderivative = 1.29 \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {6 \left (a^2 B-b^2 B-2 a b C\right ) \cot (c+d x)-3 a (2 b B+a C) \cot ^2(c+d x)-2 a^2 B \cot ^3(c+d x)+3 (a+i b)^2 (-i B+C) \log (i-\tan (c+d x))-6 \left (2 a b B+a^2 C-b^2 C\right ) \log (\tan (c+d x))+3 (a-i b)^2 (i B+C) \log (i+\tan (c+d x))}{6 d} \]
[In]
[Out]
Time = 0.40 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.15
method | result | size |
derivativedivides | \(\frac {B \,b^{2} \left (-\cot \left (d x +c \right )-d x -c \right )+C \,b^{2} \ln \left (\sin \left (d x +c \right )\right )+2 B a b \left (-\frac {\cot \left (d x +c \right )^{2}}{2}-\ln \left (\sin \left (d x +c \right )\right )\right )+2 C a b \left (-\cot \left (d x +c \right )-d x -c \right )+B \,a^{2} \left (-\frac {\cot \left (d x +c \right )^{3}}{3}+\cot \left (d x +c \right )+d x +c \right )+C \,a^{2} \left (-\frac {\cot \left (d x +c \right )^{2}}{2}-\ln \left (\sin \left (d x +c \right )\right )\right )}{d}\) | \(136\) |
default | \(\frac {B \,b^{2} \left (-\cot \left (d x +c \right )-d x -c \right )+C \,b^{2} \ln \left (\sin \left (d x +c \right )\right )+2 B a b \left (-\frac {\cot \left (d x +c \right )^{2}}{2}-\ln \left (\sin \left (d x +c \right )\right )\right )+2 C a b \left (-\cot \left (d x +c \right )-d x -c \right )+B \,a^{2} \left (-\frac {\cot \left (d x +c \right )^{3}}{3}+\cot \left (d x +c \right )+d x +c \right )+C \,a^{2} \left (-\frac {\cot \left (d x +c \right )^{2}}{2}-\ln \left (\sin \left (d x +c \right )\right )\right )}{d}\) | \(136\) |
parallelrisch | \(\frac {3 \left (2 B a b +C \,a^{2}-C \,b^{2}\right ) \ln \left (\sec \left (d x +c \right )^{2}\right )+6 \left (-2 B a b -C \,a^{2}+C \,b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )-2 B \,a^{2} \cot \left (d x +c \right )^{3}+3 \left (-2 B a b -C \,a^{2}\right ) \cot \left (d x +c \right )^{2}+6 \cot \left (d x +c \right ) \left (B \,a^{2}-B \,b^{2}-2 C a b \right )+6 d x \left (B \,a^{2}-B \,b^{2}-2 C a b \right )}{6 d}\) | \(143\) |
norman | \(\frac {\frac {\left (B \,a^{2}-B \,b^{2}-2 C a b \right ) \tan \left (d x +c \right )^{3}}{d}+\left (B \,a^{2}-B \,b^{2}-2 C a b \right ) x \tan \left (d x +c \right )^{4}-\frac {B \,a^{2} \tan \left (d x +c \right )}{3 d}-\frac {a \left (2 B b +C a \right ) \tan \left (d x +c \right )^{2}}{2 d}}{\tan \left (d x +c \right )^{4}}-\frac {\left (2 B a b +C \,a^{2}-C \,b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )}{d}+\frac {\left (2 B a b +C \,a^{2}-C \,b^{2}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}\) | \(167\) |
risch | \(B \,a^{2} x -B \,b^{2} x -2 C a b x +\frac {4 i B a b c}{d}-i C \,b^{2} x +i C \,a^{2} x -\frac {2 i \left (6 i B a b \,{\mathrm e}^{4 i \left (d x +c \right )}+3 i C \,a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-6 B \,a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+3 B \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+6 C a b \,{\mathrm e}^{4 i \left (d x +c \right )}-6 i B a b \,{\mathrm e}^{2 i \left (d x +c \right )}-3 i C \,a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+6 B \,a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-6 B \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-12 C a b \,{\mathrm e}^{2 i \left (d x +c \right )}-4 B \,a^{2}+3 B \,b^{2}+6 C a b \right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}+\frac {2 i C \,a^{2} c}{d}+2 i B a b x -\frac {2 i C \,b^{2} c}{d}-\frac {2 a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) B b}{d}-\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) C}{d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) C \,b^{2}}{d}\) | \(324\) |
[In]
[Out]
none
Time = 0.26 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.33 \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=-\frac {3 \, {\left (C a^{2} + 2 \, B a b - C b^{2}\right )} \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right )^{3} + 3 \, {\left (C a^{2} + 2 \, B a b - 2 \, {\left (B a^{2} - 2 \, C a b - B b^{2}\right )} d x\right )} \tan \left (d x + c\right )^{3} + 2 \, B a^{2} - 6 \, {\left (B a^{2} - 2 \, C a b - B b^{2}\right )} \tan \left (d x + c\right )^{2} + 3 \, {\left (C a^{2} + 2 \, B a b\right )} \tan \left (d x + c\right )}{6 \, d \tan \left (d x + c\right )^{3}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 252 vs. \(2 (107) = 214\).
Time = 2.31 (sec) , antiderivative size = 252, normalized size of antiderivative = 2.14 \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\begin {cases} \text {NaN} & \text {for}\: c = 0 \wedge d = 0 \\x \left (a + b \tan {\left (c \right )}\right )^{2} \left (B \tan {\left (c \right )} + C \tan ^{2}{\left (c \right )}\right ) \cot ^{5}{\left (c \right )} & \text {for}\: d = 0 \\\text {NaN} & \text {for}\: c = - d x \\B a^{2} x + \frac {B a^{2}}{d \tan {\left (c + d x \right )}} - \frac {B a^{2}}{3 d \tan ^{3}{\left (c + d x \right )}} + \frac {B a b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} - \frac {2 B a b \log {\left (\tan {\left (c + d x \right )} \right )}}{d} - \frac {B a b}{d \tan ^{2}{\left (c + d x \right )}} - B b^{2} x - \frac {B b^{2}}{d \tan {\left (c + d x \right )}} + \frac {C a^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - \frac {C a^{2} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} - \frac {C a^{2}}{2 d \tan ^{2}{\left (c + d x \right )}} - 2 C a b x - \frac {2 C a b}{d \tan {\left (c + d x \right )}} - \frac {C b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {C b^{2} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.38 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.26 \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {6 \, {\left (B a^{2} - 2 \, C a b - B b^{2}\right )} {\left (d x + c\right )} + 3 \, {\left (C a^{2} + 2 \, B a b - C b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 6 \, {\left (C a^{2} + 2 \, B a b - C b^{2}\right )} \log \left (\tan \left (d x + c\right )\right ) - \frac {2 \, B a^{2} - 6 \, {\left (B a^{2} - 2 \, C a b - B b^{2}\right )} \tan \left (d x + c\right )^{2} + 3 \, {\left (C a^{2} + 2 \, B a b\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{3}}}{6 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 334 vs. \(2 (114) = 228\).
Time = 0.91 (sec) , antiderivative size = 334, normalized size of antiderivative = 2.83 \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 6 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 15 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 24 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 12 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 24 \, {\left (B a^{2} - 2 \, C a b - B b^{2}\right )} {\left (d x + c\right )} + 24 \, {\left (C a^{2} + 2 \, B a b - C b^{2}\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right ) - 24 \, {\left (C a^{2} + 2 \, B a b - C b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + \frac {44 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 88 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 44 \, C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 15 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 24 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 6 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - B a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \]
[In]
[Out]
Time = 8.74 (sec) , antiderivative size = 156, normalized size of antiderivative = 1.32 \[ \int \cot ^5(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=-\frac {{\mathrm {cot}\left (c+d\,x\right )}^3\,\left (\frac {B\,a^2}{3}+{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (-B\,a^2+2\,C\,a\,b+B\,b^2\right )+\mathrm {tan}\left (c+d\,x\right )\,\left (\frac {C\,a^2}{2}+B\,b\,a\right )\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )\,\left (C\,a^2+2\,B\,a\,b-C\,b^2\right )}{d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (-C+B\,1{}\mathrm {i}\right )\,{\left (-b+a\,1{}\mathrm {i}\right )}^2}{2\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (C+B\,1{}\mathrm {i}\right )\,{\left (b+a\,1{}\mathrm {i}\right )}^2}{2\,d} \]
[In]
[Out]